﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using App.Utility;

namespace App.Account.Models.Forms
{
    public class Login : IRuleEntity
    {
        public string UserName { get; set; }
        public string Password { get; set; }


        public List<RuleViolation> GetRuleViolations()
        {
            List<RuleViolation> validationIssues = new List<RuleViolation>();

            // Basic parameter validation
            if (String.IsNullOrEmpty(UserName))
            {
                validationIssues.Add(new RuleViolation()
                {
                    PropertyName = "UserName",
                    ErrorMessage = "You must specify a username."
                });
            }
            if (String.IsNullOrEmpty(Password))
            {
                validationIssues.Add(new RuleViolation()
                {
                    PropertyName = "Password",
                    ErrorMessage = "You must specify a password."
                });
            }

            return validationIssues;
        }


    }
}
